package day_2022_1_to_2.day16;

//CC142 反转数字
//输入：-123
//返回值：-321

public class Day15_2 {
    public static void main(String[] args) {
        int num=1234567889;
        System.out.println(reverse(num));
    }
    public static int reverse (int x) {
        long n=0;
        while (x!=0){
            n = n*10+x%10;
            x = x/10;
        }
        return (int)n==n?(int)n:0;
    }
}
